﻿#region License
/* ---------------------------------------------------------------- *
 *
 * This file is part of the Xcoordination Application Space
 * ("XcoAppSpace") http://www.xcoordination.com
 *
 * Copyright (C) 2009 Xcoordination http://www.xcoordination.com
 *
 * XcoAppSpace is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General
 * Public License as published by the Free Software Foundation.
 *
 * XcoAppSpace is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/
 * or write to the Free Software Foundation, Inc., 51 Franklin
 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ---------------------------------------------------------------- */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;

namespace XcoAppSpaces.Contracts.Communication
{
	/// <summary>
	/// Description for an error that occurred during communication (serialization, 
	/// send/receive, deserialization).
	/// </summary>
	public class XcoCommunicationError
	{
		/// <summary>
		/// The exception that has been thrown.
		/// </summary>
		public Exception Error { get; set; }

		/// <summary>
		/// Additional info to the error.
		/// </summary>
		public string Info { get; set; }

		/// <summary>
		/// The address of the space where the error occurred.
		/// </summary>
		public string SourceAddress { get; set; }

		/// <summary>
		/// Creates a new XcoCommunicationError.
		/// </summary>
		public XcoCommunicationError()
		{
		}

		/// <summary>
		/// Creates a new XcoCommunicationError.
		/// </summary>
		/// <param name="error">The exception that has been thrown.</param>
		/// <param name="info">Additional info to the error.</param>
		/// <param name="sourceAddress">The address of the space where the error occurred.</param>
		public XcoCommunicationError(Exception error, string info, string sourceAddress)
		{
			this.Error = error;
			this.Info = info;
			this.SourceAddress = sourceAddress;
		}
	}
}
